#ifndef __BSP_SPI_H_
#define __BSP_SPI_H_

#ifdef __cplusplus
extern "C"
{
#endif

#include "system.h"


/* export func */

void bsp_spi3_init(void);
SPI_HandleTypeDef *bsp_spi3_get_handle(void);
void bsp_spi3_lock(void);
void bsp_spi3_unlock(void);
void bsp_spi3_set_speed(uint32_t speed);
uint8_t bsp_spi3_write_byte(uint8_t data);
uint8_t bsp_spi3_write_buff(uint8_t *data, uint32_t size);
uint8_t bsp_spi3_write_buff_dma(uint8_t *data, uint32_t size);

void bsp_spi4_init(void);
SPI_HandleTypeDef *bsp_spi4_get_handle(void);
void bsp_spi4_lock(void);
void bsp_spi4_unlock(void);
void bsp_spi4_set_speed(uint32_t speed);
uint8_t bsp_spi4_read_write_byte(uint8_t data);
uint8_t bsp_spi4_write_buff(uint8_t *data, uint32_t size);
uint8_t bsp_spi4_read_buff(uint8_t *data, uint32_t size);


#ifdef __cplusplus
}
#endif

#endif // __BSP_SPI_H_
